package com.itheima.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.mapper.UmsAdminRoleRelationMapper;
import com.itheima.pojo.UmsAdminRoleRelation;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class UmsAdminRoleRelationApiImpl implements UmsAdminRoleRelationApi{

    @Autowired
    private UmsAdminRoleRelationMapper umsAdminRoleRelationMapper;



    /**
     * 根据用户id查找对应角色
     * @param userId
     * @return
     */
    @Override
    public List<UmsAdminRoleRelation> getByAdminId(Long userId) {
        LambdaQueryWrapper<UmsAdminRoleRelation> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(UmsAdminRoleRelation::getAdminId,userId);
        return umsAdminRoleRelationMapper.selectList(wrapper);
    }
}
